Optimal. Leaf size=58 \[ \frac {(b c-a d)^2}{a b^2 (a+b x)}+\frac {c^2 \log (x)}{a^2}-\left (\frac {c^2}{a^2}-\frac {d^2}{b^2}\right ) \log (a+b x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {90}
\begin {gather*} -\left (\frac {c^2}{a^2}-\frac {d^2}{b^2}\right ) \log (a+b x)+\frac {c^2 \log (x)}{a^2}+\frac {(b c-a d)^2}{a b^2 (a+b x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rubi steps
\begin {align*} \int \frac {(c+d x)^2}{x (a+b x)^2} \, dx &=\int \left (\frac {c^2}{a^2 x}-\frac {(-b c+a d)^2}{a b (a+b x)^2}+\frac {-b^2 c^2+a^2 d^2}{a^2 b (a+b x)}\right ) \, dx\\ &=\frac {(b c-a d)^2}{a b^2 (a+b x)}+\frac {c^2 \log (x)}{a^2}-\left (\frac {c^2}{a^2}-\frac {d^2}{b^2}\right ) \log (a+b x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 60, normalized size = 1.03 \begin {gather*} \frac {c^2 \log (x)+\frac {(-b c+a d) (a (-b c+a d)+(b c+a d) (a+b x) \log (a+b x))}{b^2 (a+b x)}}{a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 78, normalized size = 1.34
method | result | size |
norman | \(-\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x}{a^{2} b \left (b x +a \right )}+\frac {c^{2} \ln \left (x \right )}{a^{2}}+\frac {\left (a^{2} d^{2}-b^{2} c^{2}\right ) \ln \left (b x +a \right )}{a^{2} b^{2}}\) | \(77\) |
default | \(\frac {\left (a^{2} d^{2}-b^{2} c^{2}\right ) \ln \left (b x +a \right )}{a^{2} b^{2}}-\frac {-a^{2} d^{2}+2 a b c d -b^{2} c^{2}}{a \,b^{2} \left (b x +a \right )}+\frac {c^{2} \ln \left (x \right )}{a^{2}}\) | \(78\) |
risch | \(\frac {a \,d^{2}}{b^{2} \left (b x +a \right )}-\frac {2 c d}{b \left (b x +a \right )}+\frac {c^{2}}{a \left (b x +a \right )}+\frac {\ln \left (-b x -a \right ) d^{2}}{b^{2}}-\frac {\ln \left (-b x -a \right ) c^{2}}{a^{2}}+\frac {c^{2} \ln \left (x \right )}{a^{2}}\) | \(87\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.32, size = 78, normalized size = 1.34 \begin {gather*} \frac {c^{2} \log \left (x\right )}{a^{2}} + \frac {b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}}{a b^{3} x + a^{2} b^{2}} - \frac {{\left (b^{2} c^{2} - a^{2} d^{2}\right )} \log \left (b x + a\right )}{a^{2} b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.84, size = 107, normalized size = 1.84 \begin {gather*} \frac {a b^{2} c^{2} - 2 \, a^{2} b c d + a^{3} d^{2} - {\left (a b^{2} c^{2} - a^{3} d^{2} + {\left (b^{3} c^{2} - a^{2} b d^{2}\right )} x\right )} \log \left (b x + a\right ) + {\left (b^{3} c^{2} x + a b^{2} c^{2}\right )} \log \left (x\right )}{a^{2} b^{3} x + a^{3} b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 107 vs.
\(2 (48) = 96\).
time = 0.38, size = 107, normalized size = 1.84 \begin {gather*} \frac {a^{2} d^{2} - 2 a b c d + b^{2} c^{2}}{a^{2} b^{2} + a b^{3} x} + \frac {c^{2} \log {\left (x \right )}}{a^{2}} + \frac {\left (a d - b c\right ) \left (a d + b c\right ) \log {\left (x + \frac {- a b c^{2} + \frac {a \left (a d - b c\right ) \left (a d + b c\right )}{b}}{a^{2} d^{2} - 2 b^{2} c^{2}} \right )}}{a^{2} b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.08, size = 108, normalized size = 1.86 \begin {gather*} -b {\left (\frac {d^{2} \log \left (\frac {{\left | b x + a \right |}}{{\left (b x + a\right )}^{2} {\left | b \right |}}\right )}{b^{3}} - \frac {c^{2} \log \left ({\left | -\frac {a}{b x + a} + 1 \right |}\right )}{a^{2} b} - \frac {\frac {b^{3} c^{2}}{b x + a} - \frac {2 \, a b^{2} c d}{b x + a} + \frac {a^{2} b d^{2}}{b x + a}}{a b^{4}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.45, size = 69, normalized size = 1.19 \begin {gather*} \frac {c^2\,\ln \left (x\right )}{a^2}-\ln \left (a+b\,x\right )\,\left (\frac {c^2}{a^2}-\frac {d^2}{b^2}\right )+\frac {a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2}{a\,b^2\,\left (a+b\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________